home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacFormat España 15
/
macformat_15.iso
/
C de cerca
/
Codewarrior Lite
/
MacOS Support
/
Headers
/
ANSI Headers
/
yxvals.h
< prev
Wrap
Text File
|
1995-12-29
|
2KB
|
87 lines
// yxvals.h values header for C++
#ifndef _YXVALS_
#define _YXVALS_
#ifndef _YVALS
#include <yvals.h>
#endif
#if __MWERKS__
#pragma options align=mac68k
#if __CFM68K__ && __USING_IMPORTED_ANSI__
#pragma import on
#endif
#endif
// typeinfo description type
typedef int _Typedesc;
// type bool
#if _HAS_BOOL_TYPE
typedef bool _Bool;
#else
typedef int _Bool;
#endif /* _HAS_BOOL_TYPE */
// exception macros
#if _HAS_EXCEPTIONS
#define _TRY_BEGIN try {
#define _CATCH_ALL } catch (...) {
#define _CATCH_END }
#define _RAISE(x) throw (x)
#define _RERAISE throw
#elif _MICROSOFT_EXCEPTIONS
#define _TRY_BEGIN TRY
#define _CATCH_ALL CATCH(CException, _PCEx)
#define _CATCH_END END_CATCH
#define _RAISE(x) THROW(&(x))
#define _RERAISE THROW_LAST()
#else /* no exceptions */
#define _TRY_BEGIN {{
#define _CATCH_ALL } if (0) {
#define _CATCH_END }}
#define _RAISE(x) xmsg::_Throw(&(x))
#define _RERAISE xmsg::_Throw(0)
#endif
// bitmask macros
#if _HAS_ENUM_OVERLOADING
#define _BITMASK(E, T) typedef E T
#define _BITMASK_OPS(T) \
inline T& operator&=(T& _X, T _Y) \
{_X = (T)((int)_X & (int)_Y); return (_X); } \
inline T& operator|=(T& _X, T _Y) \
{_X = (T)((int)_X | (int)_Y); return (_X); } \
inline T& operator^=(T& _X, T _Y) \
{_X = (T)((int)_X ^ (int)_Y); return (_X); } \
inline T operator&(T _X, T _Y) \
{return ((T)((int)_X & (int)_Y)); } \
inline T operator|(T _X, T _Y) \
{return ((T)((int)_X | (int)_Y)); } \
inline T operator^(T _X, T _Y) \
{return ((T)((int)_X ^ (int)_Y)); } \
inline T operator~(T _X) \
{return ((T)~(int)_X); }
#else
#define _BITMASK(E, T) typedef int T
#define _BITMASK_OPS(T)
#endif /* _HAS_ENUM_OVERLOADING */
#define _HAS_PJP_CLIB 1 /* for filebuf/FILE coordination */
#if __MWERKS__
#if __CFM68K__ && __USING_IMPORTED_ANSI__
#pragma import reset
#endif
#pragma options align=reset
#endif
#endif /* _YXVALS_ */
/*
* Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED.
* Consult your license regarding permissions and restrictions.
*/
/* Change log:
*94Oct03 Version received from PlumHall
*94Oct08 Inserted MW changes.
*/